<template>
  <div>
    <!-- <img src=""/> -->
    <div class="item" v-for="item in goods" :key="item.goods_id">
      <div class="img">
        <img v-lazy="item.goods_small_logo" />
      </div>
      <div class="title">{{ item.goods_name }}</div>
    </div>
  </div>
</template>
<script>
import axios from "axios";

export default {
  data() {
    return {
      goods: [],
    };
  },

  methods: {
    async getList() {
      let res = await axios.get(
        "https://api-hmugo-web.itheima.net/api/public/v1/goods/search?pagesize=40"
      );
      console.log(res.data.message.goods);

      //数据进行筛选的过程?
      this.goods = res.data.message.goods.filter(
        (item) => item.goods_small_logo
      );
    },
  },
  created() {
    // this.getList();
  },
};
</script>

<style lang="less" scoped>
img{
  width: 100%;
  height: 300px;
}
</style>